package com.sweetguy.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Schema(name = "角色添加DTO")
@Data
public class RoleInsertDTO implements Serializable {

    @NotEmpty(message = "标题不能为空")
    @Size(min = 1, max = 42, message = "标题长度必须在1~42之间")
    @Schema(description = "标题")
    private String title;

    @Size(min = 1, max = 170, message = "描述长度必须在1~170之间")
    @Schema(description = "描述")
    private String info;

    @Range(min = 0, message = "序号最小为0")
    @Schema(description = "序号")
    private Long idx;
}
